Subsurface flow control for downhole operations

ABSTRACT

A method comprises determining a first value of a formation attribute of a first zone based on a measurement by a downhole gauge, wherein the formation attribute comprises at least one of a pressure and a flow rate. An opening of a choke valve is adjusted to a first position to control flow of at least one of gas and liquid coming from the first zone based on the first value of the formation attribute. At least one of a pressure buildup and a pressure falloff of the first zone is determined. The opening of the choke valve is adjusted to a second position based on the at least one of the pressure buildup and the pressure falloff of the zone.

BACKGROUND

The disclosure generally relates to the field of downhole hydrocarbon recovery, and more particularly to subsurface flow control for downhole operations.

Control valves may be implemented in a hydrocarbon recovery operation during completion to control the flow of fluids in production or injection wells. One example of a control valve is a choke valve (also referred to as a “choke”). Choke valves are implemented to control fluid pressure and/or fluid flow rate in production or injection wells. Differential pressures between the surrounding downhole formation and a wellbore as well as the rate of fluid flow can be managed by adjusting the choke position, or by opening or closing the choke valve.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the disclosure may be better understood by referencing the accompanying drawings.

FIG. 1 depicts a two-zone stacked configuration for downhole flow control through automated choke adjustment, according to some embodiments.

FIG. 2 depicts a two-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments.

FIG. 3 depicts a three-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments.

FIG. 4 depicts a four-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments.

FIGS. 5-6 depict flowcharts of example operations for downhole adjustment of a choke valve opening position based on conditions of a formation zone, according to some embodiments.

FIG. 7 depicts an example computer, according to some embodiments.

DESCRIPTION

The description that follows includes example systems, methods, techniques, and program flows that embody aspects of the disclosure. However, it is understood that this disclosure may be practiced without these specific details. For instance, this disclosure refers to drilling as a downhole operation in illustrative examples. Aspects of this disclosure can be also applied to other downhole operations which relate to a wellbore within a subsurface formation (e.g., fracturing). In other instances, well-known instruction instances, protocols, structures and techniques have not been shown in detail in order not to obfuscate the description.

Example embodiments relate to optimizing well production using two or more downhole choke valves. During operation, the choke valves may need to be adjusted based on various formation attributes and productivity factors that may be specific to a given production or injection zone in the subsurface formation. The time interval between manually determining that a choke valve adjustment should be made, performing the calculation to determine a choke position in accordance with reservoir goals, and adjusting the choke position may introduce inefficiencies and errors in hydrocarbon recovery. For instance, manual choke adjustment may waste reservoir energy and topsides facilities energy. Manual choke adjustment may also reduce hydrocarbon production output. Additionally, performing a manual calculation to determine a choke position may introduce error resulting in downhole equipment failure, hydrocarbon production loss, or reservoir damage.

In some embodiments, to reduce inefficiencies and errors during hydrocarbon recovery operations, adjustment of a choke valve can be automated. Choke valve adjustment can be performed based on analysis of observed downhole conditions with respect to various boundaries for choke valve adjustment which have been established. Boundaries can be established for one or more of the following: (1) pressure or flow rate, (2) a time delay before taking action, (3) parameters for downhole completion operations, (4) downhole choke data, emergency and/or normal shutdown actions, and (5) reservoir information (e.g., absolute open flow potential, productivity index, breakdown pressure, permeability-thickness product, etc.). The choke valve opening position can be adjusted based in part on observing that downhole conditions in a production or injection zone are not within one or more of these boundaries. Automated choke valve adjustment based on correlation of choke position to pressure and/or flow rate and other factors based on observed conditions in the zone reduces the likelihood of error which may arise due to manual choke adjustment. For example, error can occur due to performing calculations manually or due to time delay.

In some embodiments, surface hardware that controls the choke valves can be equipped with intelligence software that incorporates an algorithm or logical loop which allows automatic downhole choke control between production or injection zones completed with subsurface control valves. The software can include a smart algorithm or loop with a graphical user interface that can be programmed by the user by setting boundaries. For example, boundary values can be set for formation attributes (pressure or rate), time delay before action (account for steady state flowing conditions), downhole custom choke information, downhole completion operating envelope boundary, emergency shutdown and/or normal shutdown actions and/or reservoir information (e.g., open flow and/or absolute open flow potential, productivity index, formation breakdown pressure, permeability-thickness product, etc.).

EXAMPLE ILLUSTRATIONS

FIGS. 1-4 depict conceptual diagrams of example systems for subsurface flow control in a multi-zone completion through choke valve adjustment, according to some embodiments. Example systems 100-400 depict two-zone, three-zone, and four-zone implementations, respectively. Inflow of fluids from or injection of fluids into zones of a formation 116 through perforations in casing 104 of a wellbore 120 is controlled for each zone in which components of the example systems 100-400 operate. Though the example systems 100-400 depict example implementations for downhole flow control for two, three, and four zones, respectively, some embodiments can include a greater number of zones. For example, embodiments of the system may facilitate flow control across six or more zones. Each of the example systems 100-400 may be installed in a production well or an injection well.

FIG. 1 depicts a two-zone stacked configuration for downhole flow control through automated choke adjustment, according to some embodiments. A downhole flow control system (hereinafter the “system”) 100 manages flow of materials produced by or injected into two zones, a zone 110 and a zone 112, through perforations 108 and perforations 114. The system 100 includes a tubing hanger 101 attached at a wellhead. The tubing hanger 101 supports a tubing 102 (e.g., production tubing). Subsurface safety valve (“SSSV”) 103 is also coupled to the tubing hanger 101. The SSSV 103 may be tubing-retrievable or wireline-retrievable and may be surface-controlled or subsurface-controlled. The system 100 also includes a choke valve 109 and a shrouded choke valve 111. The choke valve 109 and the shrouded choke valve 111 are remotely operable. For instance, the choke valve 109 and the shrouded choke valve 111 can be hydraulically actuated choke valves. The choke valve 109 controls inflow from a perforation 108. The shrouded choke valve 111 controls inflow from a perforation 114. The choke valve 109 and the shrouded choke valve 111 can be set to one of multiple opening positions for controlling the differential pressure between the formation and the wellbore 120 and/or the flow rate of the inflow from the perforations 108, 114.

The system 100 includes two installations which may be assembled in two trips. In this example, a first installation of the system 100 comprises a seal unit 113, a packer 115, a sealbore 117, fluid loss valves 119 and 121, a seal unit 123, a sealbore 125, a packer 127, and a wireline entry guide 129. The fluid loss valves 119, 121 may be ball valves or annular valves, for example. A second installation of the system 100 is installed in the second trip and is coupled to the first installation at the seal unit 113. The second installation comprises the shrouded choke valve 111, the choke valve 109, a downhole gauge 107, and a packer 105. The packers 105, 115 are secured against casing 104 of the wellbore 120 and isolate the tubing 102 from the annular region of the wellbore 120. The packers 105, 115 may be one or more of mechanical, hydraulic set, and permanent. The packers 105, 115 may be retrievable or permanent packers. The downhole gauge 107 measures and records downhole pressure and/or temperature. Though not depicted in FIG. 1, the system 100 may also include equipment for sand control. Lower completion with sand control prevents migration of reservoir sand into the wellbore 120. Examples of sand control equipment which can be incorporated in the system 100 include a standalone screen, a gravel pack, and frac pack. Sand control can also be achieved by designing the system 100 as an open hole completion with swellable packers, an open hole completion with gravel pack, or an open hole completion with expandable screens. Though not depicted in FIG. 1, the system 100 may include additional downhole sensors. For instance, flow rate sensors may be located in each zone (e.g., as part of a downhole gauge). Choke valve position sensors may also be located in choke valves installed for each zone (e.g., incorporated in the choke valve 109 and/or shrouded choke valve 111).

FIG. 1 also depicts a wellbore system controller (hereinafter “controller”) 133. The controller 133 is used to control various elements of the system 100 from a surface 106. For instance, the controller 133 may comprise a hydraulic actuator used to remotely control the choke valve 109 and the shrouded choke valve 111 (hereinafter the “choke valves 109, 111”). The controller 133 may retrieve and store data from the system 100 (e.g., pressure and/or temperature data from the downhole gauge 107). Data from the system 100 may also be communicated uphole to the controller 133. The controller 133 can additionally obtain flow rate sensor data and/or choke valve position sensor data. The controller 133 may include a graphical user interface (GUI) for input of boundaries and boundary values and/or selection of factors which influence choke valve adjustment, for displaying visual indicators of zone conditions, results of the choke valve adjustment calculations by the choke valve adjustment calculator 131, etc.

The controller 133 also includes a choke valve adjustment calculator 131. The choke valve adjustment calculator 131 determines an opening position of the choke valves 109, 111 based on conditions including flow direction objectives in a corresponding zone (e.g., inflow or outflow adjustments), values of formation attributes which influence adjustment of the opening position of the choke valve (e.g., pressure, flow rate, etc.), and/or productivity factors calculated for the zones 110, 112, such as skin value, productivity index/injectivity index, and flux. The choke valve adjustment calculator 131 facilitates intelligent completion of the wellbore 120 by leveraging data obtained for each zone 110, 112.

During adjustments of the choke valve opening position, the choke valve adjustment calculator 131 determines a port setting of the choke valves 109, 111 based on the formation attributes and the values of the formation attributes in the corresponding zones 110, 112 to be achieved as a result of choke valve adjustment. For example, if choke valve adjustment is a pressure-driven operation, the port setting may be determined as to achieve a certain differential pressure based on adjusting the opening position of the choke valve 109 or shrouded choke valve 111. As another example, if choke valve adjustment is a flow rate-driven operation, the port setting may be determined as to achieve a certain flow rate based on adjusting the opening position of the choke valve 109 or shrouded choke valve 111. In some implementations, the choke valve adjustment calculator 131 can adjust the port setting of the choke valves 109, 111 to facilitate inflow or outflow adjustments, such as a “dump flood,” in which one of the zones 110, 112 has a higher pressure of gas, oil, and/or water injecting into the other zone. For instance, the zone 110 may have a higher pressure of fluid than the zone 112 that is injecting into the zone 112. The choke valve 109 can thus be adjusted to direct injection of fluid from the zone 110 into the zone 112. The port setting of the choke valves 109, 111 can initially be determined based on formation attribute goals to be achieved and/or inflow or outflow adjustments to be made as a result of choke valve opening position adjustment.

The choke valve adjustment calculator can perform a pressure buildup or pressure falloff analysis of the zones 110, 112 based on determining that formation attributes or other defined conditions are within established boundaries as a result of adjusting the choke valves 109, 111. For instance, boundaries may be established for pressure and flow rate. If the port setting for the choke valve 109, 111 is changed, the differential pressure and flow rate resulting from the choke valve 109, 111 opening adjustment may be measured (e.g., by the downhole gauge 107 and flow rate sensors of the choke valve 109). If the measured pressure or flow rate are not within the established boundaries, the choke valve adjustment calculator may determine a new port setting for the choke valve 109, 111 to ensure that the pressure and/or flow rate do not exceed the boundaries upon readjustment of the choke valve 109, 111 port setting.

The choke valve adjustment calculator 131 can perform a pressure buildup analysis for a production well or pressure falloff analysis for an injection well based on determining that the formation attribute values are within the boundaries as a result of adjusting the port setting of the choke valves 109, 111. The choke valve adjustment calculator 131 may calculate or determine productivity factors based on the pressure buildup analysis or pressure falloff analysis to incorporate into determination of a new port setting. Examples of productivity factors include skin value, productivity index or injectivity index, and flux. For example, after opening the choke valve 109 to a specified port setting, the downhole gauge 107 may record the pressure buildup during a period in which the zone 110 is shut in. The choke valve adjustment calculator 131 can then calculate a skin value, productivity index, and/or flux for the zone 110 based on the pressure buildup.

The choke valve adjustment calculator 131 can incorporate the productivity factors determined based on the pressure buildup or falloff analysis into subsequent adjustments of the choke valve 109, 111. For instance, the choke valve adjustment calculator 131 can incorporate the skin value, productivity index, and flux into a subsequent determination of a port setting for the choke valve 109. Boundaries may be further refined based on productivity factors determined from a pressure buildup or pressure falloff analysis to further facilitate intelligent adjustment of the choke valves 109, 111. The choke valve adjustment calculator 131 may determine a new port setting for the choke valves 109, 111 periodically based on changes in conditions of the zones 110, 112 to maintain formation attribute values which are both within established boundaries and which satisfy wellbore goals for the zones 110, 112.

FIG. 2 depicts a two-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments. A downhole flow control system (hereinafter the “system”) 200 manages flow of materials produced by or injected into two zones through respective perforations 108 and perforations 114. Though not depicted in FIG. 2, FIG. 2 also can include the controller 133 for obtaining data from and communicating with completion components of the system 200 and the choke valve adjustment calculator 131 for determining adjusted choke valve opening positions as similarly described in reference to FIG. 1.

The system 200 includes a tubing hanger 201 attached at a wellhead. The tubing hanger 201 supports tubing 203 (e.g., production tubing). An SSSV 202 is also coupled to the tubing hanger 201. As similar to the SSSV 103, the SSSV 202 may be tubing-retrievable or wireline-retrievable and may be surface-controlled or subsurface-controlled.

The system 200 includes a choke valve 208 and a choke valve 214. The choke valves 208, 214 are remotely operable. For instance, the choke valves 208, 214 can be hydraulically actuated choke valves. As another example, the choke valves 208, 214 can be operated with an electric actuator(s) and/or electro-hydraulic actuator(s). The choke valve 208 controls flow incoming from the perforation 108. The choke valve 214 controls flow incoming from the perforation 114. The choke valves 208, 214 can be set to one of multiple opening positions for controlling the differential pressure between the formation 116 and the wellbore 120 and/or the flow rate of the inflow from the perforations 108, 114. In addition to the choke valves 208, 214, a downhole gauge and a packer are installed in each zone. FIG. 2 depicts a downhole gauge 206, a downhole gauge 212, a packer 204, and a packer 210. The packers 204, 210 are secured against casing 104 of the wellbore 120 and isolate the tubing 203 from the annular region of the wellbore 120. The packers 204, 210 may be one or more of mechanical, hydraulic set, and permanent. The packers 204, 210 may be retrievable or permanent packers. The downhole gauges 206, 212 measure and record downhole pressure and/or temperature of the corresponding zone.

The choke valve 208 is coupled to the downhole gauge 206. The downhole gauge 206 is attached to the packer 204. Similarly, the choke valve 214 is coupled to the downhole gauge 212. The downhole gauge 212 is attached to the packer 210. Though not depicted in FIG. 2, the system 200 may include additional downhole sensors. For instance, flow rate sensors may be located in each zone (e.g., as part of a downhole gauge). Choke valve position sensors may also be located in each zone (e.g., incorporated in the choke valves 208, 214).

A nipple 216 of the system 200 is installed downhole to the bottommost perforation, or the perforation 213. For example, the nipple 216 may be any type of landing nipple. The nipple 216 is coupled to a wireline entry guide 218.

In a two-zone completion configuration of a downhole flow control system (i.e., the system 100 and/or the system 200), some embodiments may provide for choke valve adjustment for inflow and/or outflow adjustment, such as a dump flood. A dump flood occurs when one of the two zones, or one of the zones 110, 112 corresponding to the perforations 108, 114, has a higher pressure of gas, oil, and/or water that is injecting into the other zone. For instance, the zone corresponding to the perforation 108 may have a higher pressure of oil than the zone corresponding to the perforation 114. In this instance, the reservoir layer with the higher energy injects into another reservoir layer. The opening position of a choke valve (e.g., one of the choke valves 208, 214 of the system 200) can be adjusted to provide for injection into another zone with a lower pressure. Adjusting a choke valve to induce a dump flood is one example of a target objective to be achieved by adjusting inflow or outflow of a choke valve.

Implementations may provide for adjusting inflow or outflow of a choke valve to achieve other target objectives.

FIG. 3 depicts a three-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments. A downhole flow control system (hereinafter the “system”) 300 manages flow of fluid produced by or injected into three zones—a zone 308, a zone 310, and a zone 312—through respective perforations 314, 316, 318. Though not depicted in FIG. 3, FIG. 3 also can include the controller 133 for obtaining data from and communicating with completion components of the system 300 and the choke valve adjustment calculator 131 for determining adjusted choke valve opening positions as similarly described in reference to FIG. 1.

The system 300 includes a tubing hanger 301 attached at a wellhead. The tubing hanger 301 supports tubing 302 (e.g., production tubing). SSSV 303 is also coupled to the tubing hanger 301. As similar to the SSSVs 103, 202, the SSSV 303 may be tubing-retrievable or wireline-retrievable and may be surface-controlled or subsurface-controlled. The system 300 also includes three choke valves: a choke valve 309, a choke valve 317, and a choke valve 325. The choke valves 309, 317, 325 are remotely operable. For instance, the choke valves 309, 317, 325 can be hydraulically actuated choke valves. The choke valve 309 controls inflow from the perforation 314. The choke valve 317 controls inflow from the perforation 316. The choke valve 325 controls inflow from the perforation 318. The choke valves 309, 317, 325 can be set to one of multiple opening positions for controlling the differential pressure between the formation 116 and the wellbore 120 and/or the flow rate of the inflow from the perforations 314, 316, 318.

In addition to the choke valves 309, 317, 325, a downhole gauge and a packer are installed in each zone. FIG. 3 depicts a downhole gauge 307, a downhole gauge 315, and a downhole gauge 323 and a packer 305, a packer 313, and a packer 321 installed in a respective zone. The packers 305, 313, 321 are secured against casing 104 of the wellbore 120 and isolate the tubing 302 from the annular region of the wellbore 120. The packers 305, 313, 321 may be one or more of mechanical, hydraulic set, and permanent. The packers 305, 313, 321 may be retrievable or permanent packers. The downhole gauges 307, 315, 323 measure and record downhole pressure and/or temperature of the corresponding zone (i.e., the zones 308, 310, 312).

The choke valve 309 is coupled to the downhole gauge 307. The downhole gauge 307 is attached to the packer 305. The choke valve 317 is coupled to the downhole gauge 315. The downhole gauge 315 is attached to the packer 313. The choke valve 325 is coupled to the downhole gauge 323. The downhole gauge 323 is attached to the packer 321. Though not depicted in FIG. 3, the system 300 may include additional downhole sensors, such as flow rate sensors located in each zone (e.g., as part of a downhole gauge). Choke valve position sensors may also be located in each of the zones 308, 310, 312 (e.g., incorporated in the choke valves 309, 317, and 325).

The system 300 also includes a sub 311, a sub 319, and a sub 327. The subs 311, 319, 327 include threaded connections which are leveraged for assembly of the system 300 (i.e., internal threading and/or external threading). The sub 311 connects to the choke valve 309 and the packer 313. The sub 319 connects to the choke valve 317 and the packer 321. The sub 327 connects to the choke valve 325 and a nipple 329. The nipple 329 of the system 300 is installed downhole to the bottommost perforation, or the perforation 318. For example, the nipple 329 may be any type of landing nipple. The nipple 329 is coupled to a wireline entry guide 331.

FIG. 4 depicts a four-zone inline configuration for downhole flow control through automated choke adjustment, according to some embodiments. A downhole flow control system (hereinafter the “system”) 400 manages flow of fluids produced by or injected into four zones—a zone 403, a zone 405, a zone 415, and a zone 417—through respective perforations 407, 409, 411, 413. Though not depicted in FIG. 4, FIG. 4 also can include the controller 133 for obtaining data from and communicating with completion components of the system 400 and the choke valve adjustment calculator 131 for determining adjusted choke valve opening positions as similarly described in reference to FIG. 1.

The system 400 includes a tubing hanger 402 attached at a wellhead. The tubing hanger 402 supports tubing 401 (e.g., production tubing). An SSSV 404 is also coupled to the tubing hanger 402. As similar to the SSSVs 103, 202, 303, the SSSV 404 may be tubing-retrievable or wireline-retrievable and may be surface-controlled or subsurface-controlled. The system 400 also includes four choke valves: a choke valve 410, a choke valve 418, a choke valve 426, and a choke valve 434. The choke valves 410, 418, 426, 434 are remotely operable. For instance, the choke valves 410, 418, 426, 434 can be hydraulically actuated choke valves. The choke valve 410 controls inflow from the perforation 407. The choke valve 418 controls inflow from the perforation 409. The choke valve 426 controls inflow from the perforation 411. The choke valve 434 controls inflow from the perforation 413. The choke valves 410, 418, 426, 434 can be set to one of multiple opening positions for controlling the differential pressure between the formation 116 and the wellbore 120 and/or the flow rate of the inflow from the perforations 407, 409, 411, 413.

In addition to the choke valves 410, 418, 426, 434, a downhole gauge and a packer are installed in each zone. FIG. 4 depicts a downhole gauge 408, a downhole gauge 416, a downhole gauge 424, and a downhole gauge 432 and a packer 406, a packer 414, a packer 422, and a packer 430. The packers 406, 414, 422, 430 are secured against casing 104 of the wellbore 120 and isolate the tubing 401 from the annular region of the wellbore 120. The packers 406, 414, 422, 430 may be one or more of mechanical, hydraulic set, and permanent. The packers 406, 414, 422, 430 may be retrievable or permanent packers. The downhole gauges 408, 416, 424, 432 measure and record downhole pressure and/or temperature observed for the corresponding zone. The choke valve 410 is coupled to the downhole gauge 408. The downhole gauge 408 is attached to the packer 406. The choke valve 418 is coupled to the downhole gauge 416. The downhole gauge 416 is attached to the packer 414. The choke valve 426 is coupled to the downhole gauge 424. The downhole gauge 424 is attached to the packer 422. The choke valve 434 is coupled to the downhole gauge 432. The downhole gauge 432 is attached to the packer 430. Though not depicted in FIG. 4, the system 400 may include additional downhole sensors, such as flow rate sensors (e.g., as part of a downhole gauge). Choke valve position sensors may also be located in each of the zones 403, 405, 415, 417 (e.g., incorporated in the choke valves 410, 418, 426, and 434).

The system 400 also includes four subs: a sub 412, a sub 420, a sub 428, and a sub 436. The subs 412, 420, 428, 436 include threaded connections which are leveraged for assembly of the system 400. The sub 412 connects to the choke valve 410 and the packer 414. The sub 420 connects to the choke valve 418 and the packer 422. The sub 428 connects to the choke valve 426 and the packer 430. The sub 436 connects to the choke valve 434 and a nipple 438. The nipple 438 of the system 400 is installed downhole to the bottommost perforation, or the perforation 413. For example, the nipple 438 may be any type of landing nipple. The nipple 438 is coupled to a wireline entry guide 440.

FIGS. 5-6 are flowcharts of example operations for automated downhole adjustment of a choke valve opening position based on conditions of a formation zone, according to some embodiments. The operations depicted by flowcharts 500-600 can occur for choke valve adjustment in any zone of a reservoir. The zone in which operations are being performed may correspond to any zone in any reservoir type (e.g., a two-zone reservoir, three-zone reservoir, etc.) The example operations refer to a choke valve adjustment calculator as performing the depicted operations for consistency with FIG. 1, although naming of software and program code can vary among implementations. The example operations may be performed downhole or at a formation surface (e.g., at the choke valve adjustment calculator as depicted in FIG. 1). Operations of the flowcharts 500-600 can be performed by software, firmware, hardware, or a combination thereof. Operations begin at block 502 of the flowchart 500.

At block 502, the choke valve adjustment calculator defines formation attributes for automated choke valve adjustment. The formation attributes correspond to the formation attributes in the zone which “drive” choke valve adjustment. Formation attributes may include, for example, pressure and flow rate. Choke valve adjustment may be pressure-driven, flow rate-driven, or a combination of pressure- and flow rate-driven. Formation attribute “goal” conditions to be achieved as a result of choke adjustment can be defined. For instance, defining choke valve adjustment as a pressure-driven operation may comprise determining a certain differential pressure which is to be achieved as a result of adjusting the choke valve opening. Similarly, defining choke valve adjustment as a flow rate-driven operation may comprise determining a certain flow rate which is to be achieved as a result of adjusting the choke valve opening. For example, with reference to FIG. 1, the choke valve adjustment calculator may receive selected formation attributes from input into a user-facing element of the wellbore system controller 133, such as a GUI, and store the formation attributes for subsequent reference and collection of formation attribute data by downhole gauges and/or sensors, such as the downhole gauge 107.

At block 504, the choke valve adjustment calculator defines initial conditions. Initial conditions indicate zone conditions prior to choke adjustment. Initial conditions may include pressure and temperature measurements for the zone. For instance, measurements of the differential pressure and the temperature may be retrieved from downhole gauge(s) in the zone (e.g., a pressure gauge and/or a temperature gauge). Initial conditions may also include an initial productivity index, permeability-thickness product (KH), and/or formation density calculated for the zone. Initial conditions may be defined by collecting data from downhole sensors and downhole gauges in the corresponding zone and performing calculations based on collected downhole data. For example, with reference to FIG. 1, the choke valve adjustment calculator may receive initial condition data from downhole gauges, sensors, or other subsurface components in the zone, such as from the downhole gauge 107 and sensors of the choke valve 109.

At block 506, the choke valve adjustment calculator establishes normal readings for downhole gauge and/or sensor data, boundaries, and a choke position-flow coefficient (Cv) curve. Normal readings may be established for any of the data collected for the initial conditions and/or the formation attributes. Normal readings for downhole gauge or sensor data may be ranges based on previous readings for the zone or previously evaluated zones with similar characteristics. For example, normal readings may be established for differential pressure, temperature, flow rate, etc. The boundaries comprise boundary values of various conditions which may influence choke valve adjustment. Boundaries may be established for formation attributes, such as differential pressure and/or flow rate, time delay before action (accounting for steady state flowing conditions), downhole custom choke information (e.g., flow coefficient for each choke position, pressure drop due to friction, and subsequent flow coefficient adjustment due to friction), operating envelope boundaries for the downhole completion, conditions prompting an emergency shutdown and/or normal shutdown, and/or reservoir zone information, such as open flow and/or absolute open flow potential, PI, formation breakdown pressure, KH value, and skin value. Conditions for which boundaries are to be established and the corresponding boundary values may be received from input (e.g., from a user-facing element of the wellbore system controller 133 in FIG. 1). The choke position-flow coefficient curve plots choke valve opening position against flow coefficient and barrels of water per day (BWPD) measurements. The flow coefficient corresponding to each choke valve opening position may be based on previously conducted flow testing. The BWPD measurements may be based on historical BWPD data for an indicated differential pressure at which the flow coefficients were calculated.

At block 508, the choke valve adjustment calculator determines if the initial conditions are within the normal readings. The initial condition data collected by downhole gauges, sensors, etc. is compared to the ranges representing the normal readings. An error threshold may be established for determining if the initial conditions are within the normal readings (e.g., an error threshold of 5%, 8%, etc. within the range of normal readings). If the initial conditions are not within normal readings, operations continue at block 510. If the initial conditions are within normal readings, operations continue at block 512.

At block 510, the choke valve adjustment calculator flags the zone for investigation and subsequent corrections to downhole flow control system components. Excessive discrepancies between the initial conditions and normal readings may indicate sensor failures, operational issues with the downhole gauges, etc. Operations continue at block 506 of the flowchart 500.

At block 511, the choke valve adjustment calculator determines if a flow direction adjustment is to be made. The choke valve can be adjusted to control the direction of fluid flow to achieve various target objectives for fluid flow (e.g., inflow or outflow objectives). For instance, it may be determined if a dump flood adjustment is to be made. Dump flood adjustments may be made in two-zone completions, such as the systems 100 and 200 depicted in FIGS. 1 and 2, respectively. Dump flood adjustments can be made to induce a dump flood. In this instance, the choke valve can be adjusted to facilitate injection from the reservoir layer with the higher energy into the reservoir layer with the lower energy. The dump flood adjustment may be made based on receiving downhole gauge and/or sensor data indicating a detection that the pressure of gas, oil, water, etc. in one zone is higher than that of the other zone. A threshold pressure difference which indicates a differential pressure between zones which should trigger a dump flood adjustment may be established (e.g., differences between pressures measured in zones exceeding 40%, 50%, etc.). Other flow direction adjustments can be made based on correlating downhole gauge and/or sensor data with wellbore conditions, formation attribute goal conditions, etc. The determination may also be made based on receiving input specifying that a flow direction adjustment is to be made to achieve certain target objectives, such as input into a user-facing element of the wellbore system controller 133 depicted in FIG. 1.

At block 512, the choke valve adjustment calculator communicates to the downhole choke valve to adjust its opening position based on a setting corresponding to the formation attributes, productivity factors, and/or a flow direction adjustment. For instance, with reference to FIG. 1, the opening position of the choke valve 109 can be adjusted based on communication indicating the port setting received from the choke valve adjustment calculator. The new choke valve port setting can be based on to the formation attributes, flow direction adjustment, and/or productivity factors. Productivity factors influencing choke valve adjustment may include skin value, productivity or injectivity index, and flux of fluid flowing in the zone. These productivity factors may have been determined following a previous choke adjustment operation (e.g., in a previous iteration of the choke valve adjustment at block 613 in FIG. 6). The choke valve adjustment may alternatively or in addition be based on controlling the direction of fluid flow (e.g., inflow or outflow) if it was determined that a flow direction adjustment should be made. For instance, the choke valve adjustment may be based on facilitating a dump flood. In this instance, the choke valve opening position can be adjusted as to direct injection into the zone with a lower pressure (e.g., of water, oil, or gas).

The choke valve port setting can be determined or calculated based on the formation attributes, productivity factors, and/or indication of a dump flood adjustment, where the results of the calculation may be correlated with a corresponding opening position. As an example, the relation between flow rate (q_(l)), flow coefficient, pressure change (Δp), and formation density (y_(l)) depicted in Equation 1 can be leveraged.

$\begin{matrix} {q_{l} = {C_{v}\sqrt{\frac{\Delta \; p}{\gamma_{l}}}}} & (1) \end{matrix}$

For instance, based on the flow coefficient of the current opening position (e.g., determined from the choke position-flow coefficient curve), determination of the formation density, and the pressure change measured by the downhole gauge(s), the flow rate may be calculated. A choke valve port setting can be determined based on these relationships once the flow rate and pressure change have been determined. For example, an increase in the skin value may be determined, which is indicative of damage to the wellbore. A high skin value may correspond to inefficiency in fluid flow. If a fixed flow rate has been set, the choke valve opening position can be opened to increase the flow rate to mitigate the fluid flow inefficiencies. A high skin value may also correspond to a decrease in pressure. If the formation attribute goal conditions indicate a certain differential pressure should be maintained, the choke valve opening can be decreased (i.e., closed) to limit the pressure drop across the choke valve. As another example, if the productivity index or injectivity index indicate poor performance in the zone, the choke valve opening position can be increased, or opened to a higher port setting. Additionally, increases or decreases in flux can prompt a decrease or an increase in the choke valve opening position, respectively.

At block 514, the choke valve adjustment calculator determines if the choke valve opening moved to the correct position. The determination can be made based on position data received from choke valve position sensors. For example, the expected position may be compared to the actual position indicated by the position data retrieved from the choke valve position sensor. It can be determined that the choke valve opening moved to the correct position if the expected position matches the actual position. If the choke valve opening did not move to the correct position, operations continue at block 516. If the choke valve opening moved to the correct position, operations continue at transition point A, which continues at block 601 of the flowchart 600.

At block 516, the choke valve adjustment calculator flags the choke valve for investigation and subsequent correction. Discrepancies between the expected and actual choke valve opening positions may indicate operational errors of the choke valve, position sensor errors, etc. Operations continue at block 506 of the flowchart 500.

At block 601, the choke valve adjustment calculator collects additional data corresponding to the formation attributes. The downhole gauges, sensors, or other subsurface components can take additional measurements or collect additional data for the formation attributes, such as flow rate and/or differential pressure. Collected formation attribute data may be communicated to the choke valve adjustment calculator or the choke valve adjustment calculator may retrieve the collected formation attribute data from downhole.

At block 603, the choke valve adjustment calculator determines if the formation attribute data is outside of boundaries (i.e., the boundaries established at block 606). The determination can be made based on comparing the formation attribute data collected after adjusting the choke valve opening position with the boundary values established for the formation attributes prior to choke valve adjustment. For example, if differential pressure is indicated as a formation attribute with boundary values of 65,000 Pascals and 75,000 Pascals, a differential pressure of 69,000 Pascals achieved after adjusting the choke valve opening position satisfies the conditions for the boundaries. If the formation attributes are outside of the boundaries, operations continue at block 605. If the formation attributes are not outside of the boundaries, operations continue at block 607.

At block 605, the choke valve adjustment calculator determines if the downhole gauge readings are within ranges of expected values. Ranges of expected values for downhole gauge readings may be determined based on historical data for the downhole gauge(s) in the zone. The choke valve adjustment calculator obtains downhole gauge readings and compares the readings with each applicable range of expected values, such as a range for pressure and/or a range for temperature. Readings collected for downhole data which are not within a corresponding range or within a threshold(s) of values of the range can be determined to be incorrect. Thresholds may be established to accommodate valid outliers in measurements and can indicate values above or below which are to be considered outside of expected ranges and therefore incorrect (e.g., a threshold value of 50% above or below the range of expected values). Additional examples of abnormal readings falling outside of the expected ranges include blank values or values of zero. The normal readings previously established for downhole gauges may also be leveraged for determining expected values. If the downhole gauge readings are not within expected ranges, operations continue at block 615. If the downhole gauge readings are within expected ranges, operations continue at transition point C, which continues at transition point C of the flowchart 500.

At block 615, the choke valve adjustment calculator flags the downhole gauge(s) for investigation and subsequent correction. Once flagged, the downhole gauges can be investigated to determine the cause of the readings observed outside of expected ranges. Operations continue at transition point B, which continues at transition point B of the flowchart 500.

At block 607, the choke valve adjustment calculator tracks material balance. The choke valve adjustment calculator obtains data from downhole gauges and sensors and the choke valve sensors. Material balance is tracked using the obtained data based on cumulative production or injection which has been measured during fluid production or injection. The result of tracking material balance can be leveraged to determine the amount of oil, gas, and/or water in the reservoir zone, how much fluid has been produced by or injected in the zone, and/or the type of fluid being injected.

At block 609, the choke valve adjustment calculator determines if the zone is shut in. The zone is shut in if the choke valve which manages flow control for the zone has been shut (i.e., adjusted to closing position). The choke valve may have been adjusted to the closing position after collecting formation attribute data resulting from adjusting the choke valve opening position. The determination may be made based on obtaining sensor data from the choke valve. If the zone is shut in, operations continue at block 611. If the zone is not shut in, operations continue at block 601.

At block 611, the choke valve adjustment calculator performs pressure buildup or pressure falloff analysis. For a pressure buildup analysis, the downhole gauge(s) records the increase in pressure during production prior to shutting in the zone. For a pressure falloff analysis, the downhole gauge(s) records the decrease in pressure during injection prior to shutting in the zone. The choke valve adjustment calculator can obtain downhole pressure data which was measured for the shut-in zone (e.g., by the downhole gauge 107 depicted in FIG. 1) and generate a pressure buildup or falloff curve based on the pressure data.

At block 613, the choke valve adjustment calculator determines productivity factors based on the pressure buildup or falloff analysis. Productivity factors may include skin value, flux, productivity index, and injectivity index. The skin value is an indicator of well damage and can be calculated based on the pressure buildup or pressure falloff. The productivity index, or an indicator of performance of the zone in a production well, can be determined based on the pressure buildup. An injectivity index, or an indicator of performance of the zone in an injection well, can be determined based on the pressure falloff. For instance, the productivity index and injectivity index can be calculated based results of the pressure buildup and pressure falloff, respectively (e.g. by leveraging a Hall plot). The productivity factors can be incorporated into a subsequent determination of a new choke valve opening position. The productivity factors may also be used to refine values of the previously established boundaries. For instance, the skin value may be leveraged to adjust the pressure and/or flow rate boundary values. As an example, a large skin value indicative of well damage may prompt a decrease in the values of the boundaries for differential pressure. Operations continue at transition point B, which continues at transition point B of the flowchart 500.

VARIATIONS

The flowcharts are provided to aid in understanding the illustrations and are not to be used to limit scope of the claims. The flowcharts depict example operations that can vary within the scope of the claims. Additional operations may be performed; fewer operations may be performed; the operations may be performed in parallel; and the operations may be performed in a different order. For example, the operations depicted in blocks 502 and 504 can be performed in parallel or concurrently. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by program code. The program code may be provided to a processor of a general purpose computer, special purpose computer, or other programmable machine or apparatus.

As will be appreciated, aspects of the disclosure may be embodied as a system, method or program code/instructions stored in one or more machine-readable media. Accordingly, aspects may take the form of hardware, software (including firmware, resident software, micro-code, etc.), or a combination of software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” The functionality presented as individual modules/units in the example illustrations can be organized differently in accordance with any one of platform (operating system and/or hardware), application ecosystem, interfaces, programmer preferences, programming language, administrator preferences, etc.

Any combination of one or more machine readable medium(s) may be utilized. The machine readable medium may be a machine readable signal medium or a machine readable storage medium. A machine readable storage medium may be, for example, but not limited to, a system, apparatus, or device, that employs any one of or combination of electronic, magnetic, optical, electromagnetic, infrared, or semiconductor technology to store program code. More specific examples (a non-exhaustive list) of the machine readable storage medium would include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a machine readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine readable storage medium is not a machine readable signal medium.

A machine readable signal medium may include a propagated data signal with machine readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A machine readable signal medium may be any machine readable medium that is not a machine readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

Program code embodied on a machine readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

Computer program code for carrying out operations for aspects of the disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as the Java® programming language, C++ or the like; a dynamic programming language such as Python; a scripting language such as Perl programming language or PowerShell script language; and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on a stand-alone machine, may execute in a distributed manner across multiple machines, and may execute on one machine while providing results and or accepting input on another machine.

The program code/instructions may also be stored in a machine readable medium that can direct a machine to function in a particular manner, such that the instructions stored in the machine readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.

FIG. 7 depicts an example computer, according to some embodiments. The computer system includes a processor 701 (possibly including multiple processors, multiple cores, multiple nodes, and/or implementing multi-threading, etc.). The computer system includes memory 707. The memory 707 may be system memory (e.g., one or more of cache, SRAM, DRAM, zero capacitor RAM, Twin Transistor RAM, eDRAM, EDO RAM, DDR RAM, EEPROM, NRAM, RRAM, SONOS, PRAM, etc.) or any one or more of the above already described possible realizations of machine-readable media. The computer system also includes a bus 703 (e.g., PCI, ISA, PCI-Express, HyperTransport® bus, InfiniBand® bus, NuBus, etc.) and a network interface 705 (e.g., a Fiber Channel interface, an Ethernet interface, an internet small computer system interface, SONET interface, wireless interface, etc.). The system also includes choke valve adjustment calculator 711. The choke valve adjustment calculator 711 determines a choke valve opening position based on formation attributes which influence choke valve adjustment and conditions observed in a production or injection zone. Any one of the previously described functionalities may be partially (or entirely) implemented in hardware and/or on the processor 701. For example, the functionality may be implemented with an application specific integrated circuit, in logic implemented in the processor 701, in a co-processor on a peripheral device or card, etc. Further, realizations may include fewer or additional components not illustrated in FIG. 7 (e.g., video cards, audio cards, additional network interfaces, peripheral devices, etc.). The processor 701 and the network interface 705 are coupled to the bus 703. Although illustrated as being coupled to the bus 703, the memory 707 may be coupled to the processor 701.

While the aspects of the disclosure are described with reference to various implementations and exploitations, it will be understood that these aspects are illustrative and that the scope of the claims is not limited to them. In general, techniques for automated adjustment of a downhole choke valve as described herein may be implemented with facilities consistent with any hardware system or hardware systems. Many variations, modifications, additions, and improvements are possible.

Plural instances may be provided for components, operations or structures described herein as a single instance. Finally, boundaries between various components, operations and data stores are somewhat arbitrary, and particular operations are illustrated in the context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within the scope of the disclosure. In general, structures and functionality presented as separate components in the example configurations may be implemented as a combined structure or component. Similarly, structures and functionality presented as a single component may be implemented as separate components. These and other variations, modifications, additions, and improvements may fall within the scope of the disclosure.

Use of the phrase “at least one of” preceding a list with the conjunction “and” should not be treated as an exclusive list and should not be construed as a list of categories with one item from each category, unless specifically stated otherwise. A clause that recites “at least one of A, B, and C” can be infringed with only one of the listed items, multiple of the listed items, and one or more of the items in the list and another item not listed.

EXAMPLE EMBODIMENTS

Example embodiments include the following:

A system comprises a downhole gauge to be positioned in a wellbore drilled into a subsurface formation, the downhole gauge to measure a formation attribute of a zone of a number of zones in the subsurface formation, a choke valve to control flow of at least one of gas and liquid from the zone, wherein the formation attribute comprises at least one of a pressure and a flow rate of the zone, a processor, and a computer-readable medium having instructions stored thereon that are executable by the processor to cause the processor to determine a first value of the formation attribute of the zone based on a measurement by the downhole gauge. An opening of the choke valve is adjusted to a first position based on the first value of the formation attribute. At least one of a pressure buildup and a pressure falloff of the zone is determined. The opening of the choke valve is adjusted to a second position based on the at least one of the pressure buildup and the pressure falloff of the zone.

The instructions further comprise instructions executable by the processor to cause the processor to determine a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position comprise instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position based on the productivity factor.

The instructions executable by the processor to cause the processor to adjust the opening of the choke valve comprise instructions executable by the processor to cause the processor to determine a port setting of the choke valve based on at least one of the first value of the formation attribute and the productivity factor.

The productivity factor comprises at least one of a skin value of the zone, a productivity index of the zone, an injectivity index of the zone, and a flux of the zone.

The instructions executable by the processor to cause the processor to adjust the opening of the choke valve to a first position further comprise instructions executable by the processor to cause the processor to determine a second value of the formation attribute of the zone based on the adjustment of the opening of the choke valve to the first position.

The instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position comprise instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position based on a determination that the second value of the formation attribute is within a boundary.

The instructions further comprise instructions executable by the processor to cause the processor to determine initial conditions for the zone and establish normal readings of conditions for the zone, and the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the first position is based on a determination that the initial conditions are within the normal readings.

The system further comprises instructions executable by the processor to cause the processor to adjust to the first position the opening of the choke valve to adjust a direction of flow of at least one of gas and liquid in the zone.

A method comprises determining a first value of a formation attribute of a first zone based on a measurement by a downhole gauge, wherein the formation attribute comprises at least one of a pressure and a flow rate. An opening of a choke valve is adjusted to a first position to control flow of at least one of gas and liquid coming from the first zone based on the first value of the formation attribute. At least one of a pressure buildup and a pressure falloff of the first zone is determined. The opening of the choke valve is adjusted to a second position based on the at least one of the pressure buildup and the pressure falloff of the first zone.

The method further comprises determining a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, wherein adjusting the opening of the choke valve to the second position comprises adjusting the opening of the choke valve to the second position based on the productivity factor.

Adjusting the opening of the choke valve comprises determining a port setting of the choke valve based on at least one of at least one of the formation attribute and the productivity factor.

The productivity factor comprises at least one of a skin value of the first zone, a productivity index of the first zone, an injectivity index of the first zone, and a flux of the first zone.

Adjusting the opening of the choke valve to the first position further comprises determining a second value of the formation attribute of the zone based on adjusting the opening of the choke valve to the first position.

Adjusting the opening of the choke valve to the second position comprises adjusting the opening of the choke valve to the second position based on determining that the second value of the formation attribute is within a boundary.

The method further comprises determining initial conditions for the first zone and establishing normal readings of conditions for the first zone, wherein adjusting the opening of the choke valve to the first position is based on determining that the initial conditions are within the normal readings.

The method further comprises adjusting to the first position the opening of the choke valve to adjust a direction of flow of at least one of gas and liquid in the first zone.

One or more non-transitory machine-readable storage media have program code executable by a processor to cause the processor to obtain a formation attribute of a zone of a well drilled into a subsurface formation, wherein the formation attribute comprises at least one of a pressure and a flow rate, adjust an opening of a choke valve to a first position to control flow of at least one of gas and liquid coming from the zone based on a value of the formation attribute, determine at least one of a pressure buildup and a pressure falloff of the zone, and adjust the opening of the choke valve to a second position based on the at least one of the pressure buildup and the pressure falloff of the zone.

The non-transitory machine-readable storage media further comprise program code executable by the processor to cause the processor to determine a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, wherein the program code to adjust the opening of the choke valve to the second position comprises program code to adjust the opening of the choke valve to the second position based on the productivity factor.

The program code to adjust the opening of the choke valve comprises program code to calculate a port setting of the choke valve based on at least one of at least one of the formation attribute and the productivity factor.

The program code to adjust the opening of the choke valve to the second position comprises program code to adjust the opening of the choke valve to the second position based on a determination that the value of the formation attribute is within a boundary. 

What is claimed is:
 1. A system comprising: a downhole gauge to be positioned in a wellbore drilled into a subsurface formation, the downhole gauge to measure a formation attribute of a zone of a number of zones in the subsurface formation; a choke valve to control flow of at least one of gas and liquid from the zone, wherein the formation attribute comprises at least one of a pressure and a flow rate of the zone; a processor; and a computer-readable medium having instructions stored thereon that are executable by the processor to cause the processor to, determine a first value of the formation attribute of the zone based on a measurement by the downhole gauge; adjust an opening of the choke valve to a first position based on the first value of the formation attribute; determine at least one of a pressure buildup and a pressure falloff of the zone; and adjust the opening of the choke valve to a second position based on the at least one of the pressure buildup and the pressure falloff of the zone.
 2. The system of claim 1, wherein the instructions further comprise instructions executable by the processor to cause the processor to determine a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, and wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position comprise instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position based on the productivity factor.
 3. The system of claim 2, wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve comprise instructions executable by the processor to cause the processor to determine a port setting of the choke valve based on at least one of the first value of the formation attribute and the productivity factor.
 4. The system of claim 2, wherein the productivity factor comprises at least one of a skin value of the zone, a productivity index of the zone, an injectivity index of the zone, and a flux of the zone.
 5. The system of claim 1, wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to a first position further comprise instructions executable by the processor to cause the processor to determine a second value of the formation attribute of the zone based on the adjustment of the opening of the choke valve to the first position.
 6. The system of claim 5, wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position comprise instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the second position based on a determination that the second value of the formation attribute is within a boundary.
 7. The system of claim 1, wherein the instructions further comprise instructions executable by the processor to cause the processor to determine initial conditions for the zone and establish normal readings of conditions for the zone, wherein the instructions executable by the processor to cause the processor to adjust the opening of the choke valve to the first position is based on a determination that the initial conditions are within the normal readings.
 8. The system of claim 1, further comprising instructions executable by the processor to cause the processor to adjust to the first position the opening of the choke valve to adjust a direction of flow of at least one of gas and liquid in the zone.
 9. A method comprising: determining a first value of a formation attribute of a first zone based on a measurement by a downhole gauge, wherein the formation attribute comprises at least one of a pressure and a flow rate; adjusting an opening of a choke valve to a first position to control flow of at least one of gas and liquid coming from the first zone based on the first value of the formation attribute; determining at least one of a pressure buildup and a pressure falloff of the first zone; and adjusting the opening of the choke valve to a second position based on the at least one of the pressure buildup and the pressure falloff of the first zone.
 10. The method of claim 9, further comprising determining a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, wherein adjusting the opening of the choke valve to the second position comprises adjusting the opening of the choke valve to the second position based on the productivity factor.
 11. The method of claim 10, wherein adjusting the opening of the choke valve comprises determining a port setting of the choke valve based on at least one of at least one of the formation attribute and the productivity factor.
 12. The method of claim 10, wherein the productivity factor comprises at least one of a skin value of the first zone, a productivity index of the first zone, an injectivity index of the first zone, and a flux of the first zone.
 13. The method of claim 9, wherein adjusting the opening of the choke valve to the first position further comprises determining a second value of the formation attribute of the zone based on adjusting the opening of the choke valve to the first position.
 14. The method of claim 13, wherein adjusting the opening of the choke valve to the second position comprises adjusting the opening of the choke valve to the second position based on determining that the second value of the formation attribute is within a boundary.
 15. The method of claim 9 further comprising: determining initial conditions for the first zone; and establishing normal readings of conditions for the first zone, wherein adjusting the opening of the choke valve to the first position is based on determining that the initial conditions are within the normal readings.
 16. The method of claim 9 further comprising adjusting to the first position the opening of the choke valve to adjust a direction of flow of at least one of gas and liquid in the first zone.
 17. One or more non-transitory machine-readable storage media having program code executable by a processor to cause the processor to: obtain a formation attribute of a zone of a well drilled into a subsurface formation, wherein the formation attribute comprises at least one of a pressure and a flow rate; adjust an opening of a choke valve to a first position to control flow of at least one of gas and liquid coming from the zone based on a value of the formation attribute; determine at least one of a pressure buildup and a pressure falloff of the zone; and adjust the opening of the choke valve to a second position based on the at least one of the pressure buildup and the pressure falloff of the zone.
 18. The non-transitory machine-readable storage media of claim 17, further comprising program code executable by the processor to cause the processor to determine a productivity factor of the zone based on the at least one of the pressure buildup and pressure falloff of the zone, wherein the program code to adjust the opening of the choke valve to the second position comprises program code to adjust the opening of the choke valve to the second position based on the productivity factor.
 19. The non-transitory machine-readable storage media of claim 18, wherein the program code to adjust the opening of the choke valve comprises program code to calculate a port setting of the choke valve based on at least one of at least one of the formation attribute and the productivity factor.
 20. The non-transitory machine-readable storage media of claim 17, wherein the program code to adjust the opening of the choke valve to the second position comprises program code to adjust the opening of the choke valve to the second position based on a determination that the value of the formation attribute is within a boundary. 